<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>while语句</title>
	</head>
	<body>
		<script>
			alert("老师讲解内容");
			var answer=prompt("大家会了吗");
			var count=1;
			while(answer=='n' && count<=2){
				alert("老师在讲解一遍");
				answer=prompt("大家会了吗");
				count++;
			}
			alert("放学");
		</script>
	</body>
</html>
